home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / amos2.dms / amos2.adf / PARTICLE_MAN / particle_man.ASC.pp / particle_man.ASC
Text File  |  1992-02-26  |  64KB  |  2,215 lines

  1. ' *******************************************************************
  2. '
  3. '                             PARTICLE MAN 
  4. '
  5. '                         - By Paul Nordovics -
  6. '
  7. ' Please note that this was my very first attempt at writing a game
  8. ' and so most of the code is fairly simple but it might be helpful 
  9. ' to anybody new to coding or for the curious. 
  10. ' don't try and run this listing coz it won't work as some files are 
  11. ' missing - sorry kidz !!! 
  12. ' if you want a working version get Assasins Disk 105
  13. ' *******************************************************************
  14. '
  15. ' *****************************************  
  16. ' Start off by making some variables global
  17. ' *****************************************  
  18. ' ************ 
  19. ' player stuff 
  20. ' ************ 
  21. Global _PLAYER_X,_PLAYER_Y,_PLAYER_X_COPY,_PLAYER_Y_COPY
  22. Global _PLAYER_DIRECTION,_PLAYER_FRAME,_PLAYER_FRAME_DELAY
  23. Global _PLAYER_SPEED,_PLAYER_STATE,_PLAYER_COLLECT_DELAY,DIAGONAL
  24. Global ENERGY,LIVES,_MAX_LIVES
  25. '
  26. ' ***********
  27. ' baddy stuff
  28. ' ***********
  29. Dim BADDY_X(4) : Dim BADDY_Y(4) : Dim BADDY_X_COPY(4) : Dim BADDY_Y_COPY(4)
  30. Global BADDY_X(),BADDY_Y(),BADDY_X_COPY(),BADDY_Y_COPY()
  31. Dim BADDY_DIRECTION(4) : Dim BADDY_FRAME(4) : Dim BADDY_FRAME_START(4) : Dim BADDY_STEP(4)
  32. Global BADDY_DIRECTION(),BADDY_FRAME(),BADDY_FRAME_START(),BADDY_SPEED,BADDY_STEP()
  33. Global DROP_DELAY,DROP_DELAY_MAX,DROP_DELAY_PORTAL
  34. '
  35. ' ********** 
  36. ' bomb stuff 
  37. ' ********** 
  38. Dim BOMB_X(5) : Dim BOMB_Y(5) : Dim BOMB_FRAME(5) : Dim BOMB_STATE(5)
  39. Dim BOMB_DECAY(5)
  40. Global BOMB_X(),BOMB_Y(),BOMB_FRAME(),BOMB_FRAME_DELAY,BOMBS_ON
  41. Global BOMB_STATE(),BOMB_DECAY(),BOMB_DECAY_RATE,BOMBS_TO_COLLECT
  42. '
  43. ' *********
  44. ' map stuff
  45. ' *********
  46. Dim MAP(20,13)
  47. Global MAP(),FLOOR_START,WALL_START
  48. FLOOR_START=19 : WALL_START=45
  49. '
  50. ' *******************  
  51. ' miscellaneous stuff  
  52. ' *******************  
  53. Global GAME_CYCLE,LEVEL_COMPLETE
  54. Global LEVEL,LAST_LEVEL,SCORE,DIFFICULTY,_MUSIC,SOUND
  55. '
  56. ' ******************************** 
  57. ' this string animates the portals 
  58. ' ******************************** 
  59. _PORTAL$="A0,(92,1)(93,1)(94,1)(95,1)(96,1)(97,1)(98,1)(99,1)(100,1)(101,1)(102,1)(103,1)"
  60. '
  61. ' ***************************************
  62. ' this is used to load in default options
  63. ' ***************************************
  64. Open Random 2,"mygame:options"
  65. Field 2,2 As D$
  66. R=1
  67. Get 2,R
  68. _MAX_LIVES=Val(D$)
  69. Inc R
  70. Get 2,R
  71. DIFFICULTY=Val(D$)
  72. Inc R
  73. Get 2,R
  74. _MUSIC=Val(D$)
  75. Inc R
  76. Get 2,R
  77. SOUND=Val(D$)
  78. Inc R
  79. Get 2,R
  80. _PLAYER_SPEED=Val(D$)
  81. Inc R
  82. Get 2,R
  83. DIAGONAL=Val(D$)
  84. Inc R
  85. Close 2
  86. If _MUSIC=1
  87.    Music 1
  88. End If 
  89. DROP_DELAY_PORTAL=50
  90. '
  91. ' ---------------------------------------------------------------------- 
  92. '
  93. ' ************ 
  94. ' TITLE SCREEN 
  95. ' ************ 
  96. TITLE_SCREEN:
  97. ' *********************
  98. ' get title page set up
  99. ' *********************
  100. Hide 
  101. Unpack 4 To 0
  102. Curs Off : Flash Off 
  103. Screen Display 0,128,45,,
  104. '
  105. ' *****************************************
  106. ' this cycles colours of PARTICLE MAN title
  107. ' *****************************************
  108. Shift Up 4,4,9,1
  109. '
  110. ' ************** 
  111. ' set up pointer 
  112. ' ************** 
  113. _POINTER_Y=122
  114. Bob 0,80,_POINTER_Y,9
  115. '
  116. ' ************************** 
  117. ' animate pointer using amal 
  118. ' ************************** 
  119. Channel 0 To Bob 0
  120. Amal 0,"A0,(9,4)(10,4)(11,4)(12,4)"
  121. Amal On 0
  122. '
  123. ' ********************** 
  124. ' this moves the pointer 
  125. ' ********************** 
  126. Repeat 
  127.    ' ** 
  128.    ' up 
  129.    ' ** 
  130.    If Jup(1) and _POINTER_Y>122
  131.       For A=0 To 19
  132.          Add _POINTER_Y,-1
  133.          Wait Vbl 
  134.          Bob 0,80,_POINTER_Y,
  135.       Next A
  136.    End If 
  137.    ' **** 
  138.    ' down 
  139.    ' **** 
  140.    If Jdown(1) and _POINTER_Y<162
  141.       For A=0 To 19
  142.          Add _POINTER_Y,1
  143.          Wait Vbl 
  144.          Bob 0,80,_POINTER_Y,
  145.       Next A
  146.    End If 
  147.    Bob 0,80,_POINTER_Y,
  148. Until Fire(1)
  149. '
  150. ' ******************************************************** 
  151. ' fire button was pressed so we must have picked an option 
  152. ' ******************************************************** 
  153. ' *******
  154. ' tidy up
  155. ' *******
  156. Shift Off 
  157. Amal Off 0
  158. Fade 5 : Wait 75
  159. Bob Off 0
  160. Screen Close 0
  161. '
  162. ' ***********************************************************
  163. ' now decide what option was chosen and goto relevant section
  164. ' ***********************************************************
  165. ' *********
  166. ' play game
  167. ' *********
  168. If _POINTER_Y=122 Then Goto NEW_GAME
  169. '
  170. ' *****************
  171. ' read instructions
  172. ' *****************
  173. If _POINTER_Y=142 Then Goto _INSTRUCTIONS
  174. '
  175. ' ************** 
  176. ' change options 
  177. ' ************** 
  178. If _POINTER_Y=162 Then Goto OPTIONS
  179. '
  180. ' ---------------------------------------------------------------------
  181. '
  182. ' ************ 
  183. ' INSTRUCTIONS 
  184. ' ************ 
  185. _INSTRUCTIONS:
  186. ' *************
  187. ' set up screen
  188. ' *************
  189. Screen Open 0,320,256,16,Lowres
  190. Curs Off : Flash Off : Hide 
  191. '
  192. ' ***************
  193. ' put colours = 0
  194. ' ***************
  195. For A=0 To 15 : Colour A,$0 : Next A
  196. '
  197. Pen 1 : Paper 0
  198. '
  199. ' ****************** 
  200. ' print instructions 
  201. ' ****************** 
  202. Cls 0
  203. Locate 0,0
  204. Centre "INSTRUCTIONS"
  205. Locate 0,2
  206. Print "THE IDEA WITH PARTICLE MAN IS TO"
  207. Print "COLLECT AND DISPOSE OF A NUMBER OF"
  208. Print "BOMBS WHICH ARE PLACED IN THE MAZE AT"
  209. Print "RANDOM BY THE MONSTERS."
  210. Print "THE BOMBS HAVE A LIMITED LIFE AND IF"
  211. Print "LEFT ALONE FOR TOO LONG WILL EXPLODE."
  212. Print "IF THIS HAPPENS, PARTICLE MAN LOSES"
  213. Print "SOME ENERGY AND IF ALL HIS ENERGY IS"
  214. Print "LOST HE LOSES A LIFE. A COLLISION"
  215. Print "WITH ANY OF THE MONSTERS ALSO RESULTS"
  216. Print "IN A LOSS OF LIFE."
  217. Print "AS A WARNING, WHEN A BOMB'S TIMER IS"
  218. Print "BELOW THE HALF-WAY STAGE, IT WILL FLASH."
  219. Print 
  220. Print "TO DISPOSE OF A BOMB PARTICLE MAN FIRST"
  221. Print "NEEDS TO ABSORB IT. IF THE BOMBS ARE"
  222. Print "CLOSE TOGETHER, RUN OVER THE ONE YOU"
  223. Print "WANT AND PRESS FIRE. IF THE BOMBS ARE"
  224. Print "FAR APART HOLD DOWN FIRE AND PARTICLE"
  225. Print "MAN WILL ABSORB THE FIRST BOMB HE"
  226. Print "ENCOUNTERS. THE BOMB WILL STAY ABSORBED"
  227. Print "UNTIL YOU LET GO OF THE FIRE BUTTON."
  228. Print "ONCE PARTICLE MAN HAS ABSORBED A BOMB"
  229. Print "HE CAN DISPOSE OF IT BY SIMPLY RUNNING"
  230. Print "OVER A PORTAL."
  231. Locate 0,31
  232. Centre "PRESS <FIRE>"
  233. '
  234. ' ************ 
  235. ' fade in text 
  236. ' ************ 
  237. Fade 5,-1,%1111111111111110
  238. '
  239. ' ********************************** 
  240. ' wait for fire button to be pressed 
  241. ' ********************************** 
  242. Repeat 
  243. Until Fire(1)
  244. '
  245. ' *************  
  246. ' fade out text
  247. ' *************  
  248. Fade 5 : Wait 75
  249. '
  250. ' *********
  251. ' next page
  252. ' *********
  253. Cls 0
  254. Locate 0,0 : Centre "INSTRUCTIONS"
  255. Locate 0,2
  256. Print "IF A BOMB IS ABSORBED IT'S TIMER IS"
  257. Print "TEMPORARILY DISABLED AND IF RETURNED"
  258. Print "TO THE SCREEN (BY LETTING GO OF FIRE)"
  259. Print "WILL COUNTDOWN FROM THE BEGINING AGAIN."
  260. Print 
  261. Print "TO COMPLETE THE LEVEL YOU MUST DISPOSE"
  262. Print "OF THE AMOUNT OF BOMBS INDICATED ON THE"
  263. Print "STATUS PANEL AT THE BOTTOM OF THE"
  264. Print "SCREEN."
  265. Print 
  266. Print "PARTICLE MAN IS CONTROLLED USING A"
  267. Print "JOYSTICK IN PORT 1 AND YOU CAN ABORT"
  268. Print "A GAME BY PRESSING THE <ESC> KEY."
  269. Print 
  270. Print "YOU'LL NEED 1 MEG FOR THIS GAME TO WORK.";
  271. Print "(SORRY 1/2 MEG OWNERS!)"
  272. Locate 0,31 : Centre "PRESS <FIRE>"
  273. '
  274. ' *******
  275. ' fade in
  276. ' *******
  277. Fade 5,-1,%1111111111111110
  278. '
  279. ' ********************************** 
  280. ' wait for fire button to be pressed 
  281. ' ********************************** 
  282. Repeat 
  283. Until Fire(1)
  284. '
  285. ' ******** 
  286. ' fade out 
  287. ' ******** 
  288. Fade 5 : Wait 75
  289. '
  290. ' *********
  291. ' next page
  292. ' *********
  293. Cls 0
  294. Locate 0,0 : Centre "INSTRUCTIONS"
  295. Locate 0,2
  296. Print "OPTIONS PAGE:"
  297. Print "MOVE THE JOYSTICK UP AND DOWN TO SELECT"
  298. Print "AN OPTION AND PRESS FIRE TO CYCLE"
  299. Print "THROUGH THE SETTINGS."
  300. Print 
  301. Print "LIVES (1-8):"
  302. Print "A LOW SETTING GIVES YOU A HIGHER SCORE."
  303. Print 
  304. Print "DIFFICULTY (EASY-MANIC!):"
  305. Print "CHOOSE 'VERY HARD' OR 'MANIC' IF YOU"
  306. Print "WANT TO PLAY THE WHOLE GAME."
  307. Print 
  308. Print "MUSIC (ON/OFF): OBVIOUS!"
  309. Print 
  310. Print "SOUND (ON/OFF): OBVIOUS!"
  311. Print 
  312. Print "GAME SPEED (SLOW/FAST):"
  313. Print "IF YOU FIND PARTICLE MAN A BIT"
  314. Print "DIFFICULT TO CONTROL, TRY THE SLOWER"
  315. Print "SETTING."
  316. Print 
  317. Print "DIAGONAL MOVEMENT (ON/OFF):"
  318. Print "TURN OFF TO STOP THE JOYSTICK DIAGONALS"
  319. Print "FROM BEING READ."
  320. Locate 0,31 : Centre "PRESS <FIRE>."
  321. '
  322. ' *******
  323. ' fade in
  324. ' *******
  325. Fade 5,-1,%1111111111111110
  326. '
  327. ' ********************************** 
  328. ' wait for fire button to be pressed 
  329. ' ********************************** 
  330. Repeat 
  331. Until Fire(1)
  332. '
  333. ' ******** 
  334. ' fade out 
  335. ' ******** 
  336. Fade 5 : Wait 75
  337. '
  338. ' *********
  339. ' next page
  340. ' *********
  341. Cls 0
  342. Locate 0,0 : Centre "INSTRUCTIONS"
  343. Locate 0,2
  344. Print "SAVE OPTIONS:"
  345. Print "CHOOSE THIS IF YOU WANT YOUR NEW"
  346. Print "SETTINGS SAVED ONTO THE DISC. CAREFUL"
  347. Print "AS THERE IS NO WAY OF GETTING THE"
  348. Print "ORIGINAL SETTINGS BACK."
  349. Print 
  350. Print "EXIT:"
  351. Print "TAKES YOU BACK TO THE TITLE PAGE."
  352. Locate 0,31 : Centre "PRESS <FIRE>."
  353. '
  354. ' *******
  355. ' fade in
  356. ' *******
  357. Fade 5,-1,%1111111111111110
  358. '
  359. ' ********************************** 
  360. ' wait for fire button to be pressed 
  361. ' ********************************** 
  362. Repeat 
  363. Until Fire(1)
  364. '
  365. ' ******** 
  366. ' fade out 
  367. ' ******** 
  368. Fade 5 : Wait 75
  369. '
  370. ' *********
  371. ' next page
  372. ' *********
  373. Cls 0
  374. Locate 0,0 : Centre "INSTRUCTIONS"
  375. Locate 0,2
  376. Centre "THIS GAME WAS WRITTEN AND COMPILED"
  377. Print 
  378. Centre "USING AMOS AND IS PUBLIC DOMAIN."
  379. Print 
  380. Print 
  381. Print 
  382. Print 
  383. Print "IF ANYBODY HAS ANY COMMENTS ON THIS"
  384. Print "GAME OR JUST WANTS TO DROP ME A LINE"
  385. Print "WRITE TO:"
  386. Print 
  387. Print "PAUL NORDOVICS"
  388. Print "4 KATHARINE STREET"
  389. Print "MILLOM"
  390. Print "CUMBRIA LA18 4AQ"
  391. Print 
  392. Print "I AM ALSO LOOKING FOR A DECENT ARTIST"
  393. Print "TO DO SOME GRAPHICS FOR MY NEXT GAME"
  394. Print "SO IF YOU WANT TO HELP PLEASE WRITE."
  395. Print 
  396. Print "IF YOU LIKE THIS GAME AND WOULD LIKE AN"
  397. Print "ENHANCED VERSION CONTAINING MORE LEVELS"
  398. Print "MONSTERS/MAP EDITOR ETC SEND £5 TO THE"
  399. Print "ABOVE ADDRESS."
  400. Print 
  401. Print "HAVE FUN!!!"
  402. Locate 0,31 : Centre "PRESS <FIRE>."
  403. '
  404. ' *******
  405. ' fade in
  406. ' *******
  407. Fade 5,-1,%1111111111111110
  408. '
  409. ' ********************************** 
  410. ' wait for fire button to be pressed 
  411. ' ********************************** 
  412. Repeat 
  413. Until Fire(1)
  414. '
  415. ' ******** 
  416. ' fade out 
  417. ' ******** 
  418. Fade 5 : Wait 75
  419. '
  420. ' *******************************  
  421. ' set up instructions iff picture  
  422. ' *******************************  
  423. Load Iff "mygame:instr.iff",0
  424. Curs Off : Flash Off 
  425. Double Buffer 
  426. Screen Hide 
  427. '
  428. ' **************************** 
  429. ' set up animations using amal 
  430. ' ****************************   
  431. Bob 0,59,44,9
  432. Channel 0 To Bob 0
  433. Amal 0,"A0,(9,5)(10,5)(11,5)(12,5)"
  434. Bob 1,129,34,75
  435. Channel 1 To Bob 1
  436. Amal 1,"A0,(75,5)(76,5)"
  437. Bob 2,132,54,86
  438. Channel 2 To Bob 2
  439. Amal 2,"A0,(86,5)(87,5)"
  440. Bob 3,149,46,81
  441. Channel 3 To Bob 3
  442. Amal 3,"A0,(81,5)(82,5)"
  443. Bob 4,218,50,92
  444. Channel 4 To Bob 4
  445. Amal 4,"A0,(92,3)(93,3)(94,3)(95,3)(96,3)(97,3)(98,3)(99,3)(100,3)(101,3)(102,3)(103,3)"
  446. Bob 5,128,158,63
  447. Channel 5 To Bob 5
  448. Amal 5,"A0,(63,5)(64,5)(65,5)(66,5)"
  449. Bob 6,128,193,59
  450. Channel 6 To Bob 6
  451. Amal 6,"A0,(59,5)(60,5)(61,5)(62,5)"
  452. Bob 7,164,158,67
  453. Channel 7 To Bob 7
  454. Amal 7,"A0,(67,5)(68,5)(69,5)(70,5)"
  455. Bob 8,166,193,71
  456. Channel 8 To Bob 8
  457. Amal 8,"A0,(71,5)(72,5)(73,5)(74,5)"
  458. Amal On 
  459. Wait Vbl 
  460. '
  461. ' *****************************
  462. ' show instructions iff picture
  463. ' *****************************
  464. Screen Show 
  465. '
  466. ' ********************************** 
  467. ' wait for fire button to be pressed 
  468. ' ********************************** 
  469. Repeat 
  470. Until Fire(1)
  471. '
  472. ' *******
  473. ' tidy up
  474. ' *******
  475. For A=0 To 8 : Amal Off A : Next A
  476. '
  477. Fade 5 : Wait 75
  478. '
  479. For A=0 To 8 : Bob Off A : Next A
  480. '
  481. Screen Close 0
  482. '
  483. ' ********************************** 
  484. ' and bugger off back 2 title screen 
  485. ' ********************************** 
  486. Goto TITLE_SCREEN
  487. '
  488. ' -------------------------------------------------------------------- 
  489. '
  490. ' *******
  491. ' OPTIONS
  492. ' *******
  493. OPTIONS:
  494. ' *************
  495. ' set up screen
  496. ' *************
  497. Screen Open 0,320,256,2,Lowres
  498. Curs Off : Flash Off : Hide 
  499. Cls 0
  500. Double Buffer : Bob Update On 
  501. Colour 1,$AAA
  502. '
  503. ' *******************************
  504. ' set initial position of pointer
  505. ' *******************************
  506. _POINTER_Y=82
  507. '
  508. ' **************************** 
  509. ' show current option settings 
  510. ' **************************** 
  511. Locate 0,6
  512. Centre "OPTIONS"
  513. Locate 9,10 : Print "LIVES=";_MAX_LIVES
  514. If DIFFICULTY=0
  515.    DIFFICULTY$="EASY"
  516. End If 
  517. If DIFFICULTY=1
  518.    DIFFICULTY$="NORMAL"
  519. End If 
  520. If DIFFICULTY=2
  521.    DIFFICULTY$="HARD"
  522. End If 
  523. If DIFFICULTY=3
  524.    DIFFICULTY$="VERY HARD"
  525. End If 
  526. If DIFFICULTY=4
  527.    DIFFICULTY$="MANIC!"
  528. End If 
  529. Locate 9,12 : Print "DIFFICULTY IS ";DIFFICULTY$
  530. If _MUSIC=0
  531.    _MUSIC$="OFF"
  532. End If 
  533. If _MUSIC=1
  534.    _MUSIC$="ON"
  535. End If 
  536. Locate 9,14 : Print "MUSIC IS ";_MUSIC$
  537. If SOUND=0
  538.    SOUND$="OFF"
  539. End If 
  540. If SOUND=1
  541.    SOUND$="ON"
  542. End If 
  543. Locate 9,16 : Print "SOUND FX ARE ";SOUND$
  544. Locate 9,18
  545. If _PLAYER_SPEED=2
  546.    Print "GAME SPEED IS SLOW"
  547. End If 
  548. If _PLAYER_SPEED=4
  549.    Print "GAME SPEED IS FAST"
  550. End If 
  551. If DIAGONAL=0
  552.    DIAGONAL$="OFF"
  553. End If 
  554. If DIAGONAL=1
  555.    DIAGONAL$="ON"
  556. End If 
  557. Locate 9,20 : Print "DIAGONAL MOVEMENT IS ";DIAGONAL$
  558. Locate 9,22 : Print "SAVE OPTIONS"
  559. Locate 9,24 : Print "EXIT"
  560. '
  561. ' ****************** 
  562. ' option screen loop 
  563. ' ****************** 
  564. Repeat 
  565.    Wait 10
  566.    ' ***************
  567.    ' move pointer up
  568.    ' ***************
  569.    If Jup(1) and _POINTER_Y>82
  570.       Add _POINTER_Y,-16
  571.    End If 
  572.    ' *****************
  573.    ' move pointer down
  574.    ' *****************
  575.    If Jdown(1) and _POINTER_Y<194
  576.       Add _POINTER_Y,16
  577.    End If 
  578.    ' **************************************** 
  579.    ' if fire button is pressed we need to 
  580.    ' change an option or SAVE options or EXIT 
  581.    ' **************************************** 
  582.    If Fire(1)
  583.       ' ************ 
  584.       ' change lives 
  585.       ' ************   
  586.       If _POINTER_Y=82
  587.          Add _MAX_LIVES,1
  588.          If _MAX_LIVES>8
  589.             _MAX_LIVES=1
  590.          End If 
  591.          Locate 9,10 : Print "LIVES=";_MAX_LIVES
  592.       End If 
  593.       ' *****************  
  594.       ' change difficulty  
  595.       ' *****************  
  596.       If _POINTER_Y=98
  597.          Inc DIFFICULTY
  598.          If DIFFICULTY>4
  599.             DIFFICULTY=0
  600.          End If 
  601.          Locate 23,12 : Print "           "
  602.          Locate 9,12
  603.          If DIFFICULTY=0
  604.             DIFFICULTY$="EASY"
  605.          End If 
  606.          If DIFFICULTY=1
  607.             DIFFICULTY$="NORMAL"
  608.          End If 
  609.          If DIFFICULTY=2
  610.             DIFFICULTY$="HARD"
  611.          End If 
  612.          If DIFFICULTY=3
  613.             DIFFICULTY$="VERY HARD"
  614.          End If 
  615.          If DIFFICULTY=4
  616.             DIFFICULTY$="MANIC!"
  617.          End If 
  618.          Print "DIFFICULTY IS ";DIFFICULTY$
  619.       End If 
  620.       ' ********************** 
  621.       ' change music to on/off 
  622.       ' ********************** 
  623.       _DONE=0
  624.       If _POINTER_Y=114
  625.          If _MUSIC=0 and _DONE=0
  626.             _MUSIC=1
  627.             Locate 18,14 : Print "   "
  628.             Locate 9,14 : Print "MUSIC IS ON"
  629.             Music 1
  630.             _DONE=1
  631.          End If 
  632.          If _MUSIC=1 and _DONE=0
  633.             _MUSIC=0
  634.             Locate 18,14 : Print "   "
  635.             Locate 9,14 : Print "MUSIC IS OFF"
  636.             Music Off 
  637.             _DONE=1
  638.          End If 
  639.       End If 
  640.       ' *************************  
  641.       ' change sound fx to on/off
  642.       ' *************************  
  643.       _DONE=0
  644.       If _POINTER_Y=130
  645.          If SOUND=0 and _DONE=0
  646.             SOUND=1
  647.             Locate 22,16 : Print "   "
  648.             Locate 9,16 : Print "SOUND FX ARE ON"
  649.             _DONE=1
  650.          End If 
  651.          If SOUND=1 and _DONE=0
  652.             SOUND=0
  653.             Locate 22,16 : Print "   "
  654.             Locate 9,16 : Print "SOUND FX ARE OFF"
  655.             _DONE=1
  656.          End If 
  657.       End If 
  658.       ' *****************  
  659.       ' change game speed  
  660.       ' *****************  
  661.       If _POINTER_Y=146
  662.          _PLAYER_SPEED=_PLAYER_SPEED*2
  663.          If _PLAYER_SPEED>4
  664.             _PLAYER_SPEED=2
  665.          End If 
  666.          Locate 9,18
  667.          If _PLAYER_SPEED=2
  668.             Print "GAME SPEED IS SLOW"
  669.          End If 
  670.          If _PLAYER_SPEED=4
  671.             Print "GAME SPEED IS FAST"
  672.          End If 
  673.       End If 
  674.       ' ********************************** 
  675.       ' change diagonal movement to on/off 
  676.       ' ********************************** 
  677.       _DONE=0
  678.       If _POINTER_Y=162
  679.          If DIAGONAL=0 and _DONE=0
  680.             DIAGONAL=1
  681.             Locate 30,20 : Print "    "
  682.             Locate 9,20 : Print "DIAGONAL MOVEMENT IS ON"
  683.             _DONE=1
  684.          End If 
  685.          If DIAGONAL=1 and _DONE=0
  686.             DIAGONAL=0
  687.             Locate 30,20 : Print "    "
  688.             Locate 9,20 : Print "DIAGONAL MOVEMENT IS OFF"
  689.             _DONE=1
  690.          End If 
  691.       End If 
  692.       ' ******************** 
  693.       ' save options to disk 
  694.       ' ******************** 
  695.       If _POINTER_Y=178
  696.          Open Random 2,"mygame:options"
  697.          Field 2,2 As D$
  698.          R=1
  699.          D$=Str$(_MAX_LIVES)
  700.          Put 2,R
  701.          Inc R
  702.          D$=Str$(DIFFICULTY)
  703.          Put 2,R
  704.          Inc R
  705.          D$=Str$(_MUSIC)
  706.          Put 2,R
  707.          Inc R
  708.          D$=Str$(SOUND)
  709.          Put 2,R
  710.          Inc R
  711.          D$=Str$(_PLAYER_SPEED)
  712.          Put 2,R
  713.          Inc R
  714.          D$=Str$(DIAGONAL)
  715.          Put 2,R
  716.          Inc R
  717.          Close 2
  718.       End If 
  719.    End If 
  720.    ' ************ 
  721.    ' show pointer 
  722.    ' ************ 
  723.    Bob 0,48,_POINTER_Y,169
  724. Until Fire(1) and _POINTER_Y=194
  725. '
  726. ' ***************************************************************  
  727. ' comes to here if EXIT option was chosen and fire button pressed  
  728. ' ***************************************************************  
  729. ' ******** 
  730. ' fade out 
  731. ' ******** 
  732. Fade 5 : Wait 75
  733. '
  734. ' *******
  735. ' tidy up
  736. ' *******
  737. Screen Close 0
  738. '
  739. ' *******************
  740. ' back 2 title screen
  741. ' *******************
  742. Goto TITLE_SCREEN
  743. '
  744. ' ---------------------------------------------------------------------- 
  745. '
  746. ' *****************
  747. ' PLAY THE GAME !!!
  748. ' *****************
  749. NEW_GAME:
  750. ' *************************************  
  751. ' restore values of some game variables
  752. ' *************************************  
  753. LIVES=_MAX_LIVES-1
  754. ENERGY=3
  755. LEVEL=1
  756. SCORE=0
  757. STATUS_SCREEN_ON=0
  758. '
  759. ' *********************************************
  760. ' work out how many levels we are allowed to do
  761. ' depends on which difficulty level was chosen 
  762. ' *********************************************
  763. LAST_LEVEL=20
  764. If DIFFICULTY=0
  765.    LAST_LEVEL=5
  766. End If 
  767. If DIFFICULTY=1
  768.    LAST_LEVEL=10
  769. End If 
  770. If DIFFICULTY=2
  771.    LAST_LEVEL=15
  772. End If 
  773. Goto NEW_LEVEL
  774. '
  775. ' ---------------------------------------------------------------------- 
  776. '
  777. ' ********************************************************************** 
  778. '
  779. '                               MAIN LOOP
  780. '
  781. ' ***********************************************************************  
  782. _START_GAME:
  783. Repeat 
  784.    Wait Vbl 
  785.    Bob Clear 
  786.    ' ************** 
  787.    ' player routine 
  788.    ' ************** 
  789.    MOVE_PLAYER
  790.    If GAME_CYCLE=0
  791.       Wait Vbl 
  792.       ' *********************
  793.       ' quit if <Esc> pressed
  794.       ' *********************
  795.       If Key State($45)
  796.          LIVES=-1
  797.       End If 
  798.       ' **************************** 
  799.       ' complete level if F1 pressed 
  800.       ' **************************** 
  801.       If Key State($50)
  802.          LEVEL_COMPLETE=1
  803.       End If 
  804.       ' *************
  805.       ' baddy routine
  806.       ' *************
  807.       MOVE_BADDY
  808.    End If 
  809.    If GAME_CYCLE=1
  810.       Wait Vbl 
  811.       ' ************ 
  812.       ' bomb routine 
  813.       ' ************ 
  814.       BOMB
  815.    End If 
  816.    Bob Draw 
  817.    Add GAME_CYCLE,1,0 To 1
  818.    Screen Swap 
  819. Until LEVEL_COMPLETE=1 or LIVES=-1 or(LIVES<=0 and ENERGY=0)
  820. '
  821. ' *******************************************
  822. ' we come here when either the game has ended  
  823. ' or we have completed the current level 
  824. ' *******************************************
  825. ' *******************
  826. ' level was completed
  827. ' *******************
  828. If LEVEL_COMPLETE=1 Then Goto LEVEL_COMPLETE
  829. '
  830. ' *********
  831. ' game over
  832. ' *********
  833. If LIVES<=0 Then Goto GAME_OVER
  834. '
  835. ' ------------------------------------------------------------------------ 
  836. '
  837. ' *********
  838. ' NEW LEVEL
  839. ' *********
  840. NEW_LEVEL:
  841. ' ******************************** 
  842. ' restore values of game variables 
  843. ' ******************************** 
  844. ' ****** 
  845. ' player 
  846. ' ****** 
  847. _PLAYER_DIRECTION=8 : _PLAYER_FRAME=9
  848. _PLAYER_STATE=0 : _PLAYER_COLLECT_DELAY=16
  849. '
  850. ' ******** 
  851. ' monsters 
  852. ' ******** 
  853. For A=0 To 3
  854.    BADDY_DIRECTION(A)=1 : BADDY_SPEED=_PLAYER_SPEED/2
  855.    BADDY_STEP(A)=128
  856. Next A
  857. '
  858. ' *****
  859. ' bombs
  860. ' *****
  861. For COUNT=0 To 4 : BOMB_STATE(COUNT)=0 : Next COUNT
  862. BOMBS_ON=0
  863. '
  864. ' **** 
  865. ' misc 
  866. ' **** 
  867. _PORTAL_COUNT=0 : Rem keeps track of how many bases in map 
  868. LEVEL_COMPLETE=0
  869. '
  870. ' ************************************ 
  871. ' set level information  
  872. ' i.e how many bombs need disposing of 
  873. ' bomb decay rate etc... 
  874. ' ************************************ 
  875. If LEVEL=1
  876.    BOMBS_TO_COLLECT=5
  877.    BOMB_DECAY_RATE=(500-(DIFFICULTY*50))*(4/_PLAYER_SPEED)
  878.    For A=0 To 3
  879.       BADDY_FRAME_START(A)=59
  880.    Next A
  881. End If 
  882. If LEVEL=2
  883.    BOMBS_TO_COLLECT=6
  884.    For A=0 To 3
  885.       BADDY_FRAME_START(A)=63
  886.    Next A
  887. End If 
  888. If LEVEL=3
  889.    BOMBS_TO_COLLECT=7
  890.    For A=0 To 3
  891.       BADDY_FRAME_START(A)=67
  892.    Next A
  893. End If 
  894. If LEVEL=4
  895.    BOMBS_TO_COLLECT=8
  896.    For A=0 To 3
  897.       BADDY_FRAME_START(A)=71
  898.    Next A
  899. End If 
  900. If LEVEL=5
  901.    BOMBS_TO_COLLECT=9
  902. End If 
  903. If LEVEL=6
  904.    BOMBS_TO_COLLECT=5
  905.    BOMB_DECAY_RATE=(480-(DIFFICULTY*50))*(4/_PLAYER_SPEED)
  906. End If 
  907. If LEVEL=7
  908.    BOMBS_TO_COLLECT=6
  909. End If 
  910. If LEVEL=8
  911.    BOMBS_TO_COLLECT=7
  912. End If 
  913. If LEVEL=9
  914.    BOMBS_TO_COLLECT=8
  915. End If 
  916. If LEVEL=10
  917.    BOMBS_TO_COLLECT=9
  918. End If 
  919. If LEVEL=11
  920.    BOMBS_TO_COLLECT=5
  921.    BOMB_DECAY_RATE=(460-(DIFFICULTY*50))*(4/_PLAYER_SPEED)
  922. End If 
  923. If LEVEL=12
  924.    BOMBS_TO_COLLECT=6
  925. End If 
  926. If LEVEL=13
  927.    BOMBS_TO_COLLECT=7
  928. End If 
  929. If LEVEL=14
  930.    BOMBS_TO_COLLECT=8
  931. End If 
  932. If LEVEL=15
  933.    BOMBS_TO_COLLECT=9
  934. End If 
  935. If LEVEL=16
  936.    BOMBS_TO_COLLECT=5
  937.    BOMB_DECAY_RATE=(440-(DIFFICULTY*50))*(4/_PLAYER_SPEED)
  938. End If 
  939. If LEVEL=17
  940.    BOMBS_TO_COLLECT=6
  941. End If 
  942. If LEVEL=18
  943.    BOMBS_TO_COLLECT=7
  944. End If 
  945. If LEVEL=19
  946.    BOMBS_TO_COLLECT=8
  947. End If 
  948. If LEVEL=20
  949.    BOMBS_TO_COLLECT=9
  950. End If 
  951. If LEVEL>4
  952.    For A=0 To 3
  953.       BADDY_FRAME_START(A)=(Rnd(3)*4)+59
  954.    Next A
  955. End If 
  956. '
  957. ' **************************************** 
  958. ' give monsters the correct starting frame 
  959. ' **************************************** 
  960. For A=0 To 3
  961.    BADDY_FRAME(A)=BADDY_FRAME_START(A)
  962. Next A
  963. '
  964. ' ************************************************ 
  965. ' work out how fast bombs can be dropped into maze 
  966. ' ************************************************ 
  967. DROP_DELAY_MAX=DROP_DELAY_PORTAL-((LEVEL*2)-2)
  968. DROP_DELAY=DROP_DELAY_MAX
  969. '
  970. ' ***********************************************  
  971. ' set up our big screen - where the maze is drawn
  972. ' ***********************************************  
  973. Screen Open 0,320,224,16,Lowres
  974. Curs Off : Flash Off : Hide 
  975. Screen Hide 
  976. Screen Display 0,128,45,320,208
  977. '
  978. ' ***************
  979. ' put colours = 0
  980. ' ***************
  981. For A=0 To 15 : Colour A,$0 : Next A
  982. '
  983. Cls 0
  984. '
  985. Bob Update On 
  986. '
  987. ' *****************************************  
  988. ' Load in map data and player/baddy co-ords  
  989. ' *****************************************  
  990. Open Random 1,"mygame:Map_data"
  991. Field 1,4 As D$
  992. R=((LEVEL-1)*270)+1
  993. For D=0 To 12
  994.    For A=0 To 19
  995.       Get 1,R
  996.       MAP(A,D)=Val(D$)
  997.       Inc R
  998.    Next A
  999. Next D
  1000. Get 1,R
  1001. _PLAYER_X=Val(D$) : _PLAYER_X_COPY=_PLAYER_X
  1002. Inc R
  1003. Get 1,R
  1004. _PLAYER_Y=Val(D$) : _PLAYER_Y_COPY=_PLAYER_Y
  1005. Inc R
  1006. For A=0 To 3
  1007.    Get 1,R
  1008.    BADDY_X(A)=Val(D$) : BADDY_X_COPY(A)=BADDY_X(A)
  1009.    Inc R
  1010.    Get 1,R
  1011.    BADDY_Y(A)=Val(D$) : BADDY_Y_COPY(A)=BADDY_Y(A)
  1012.    Inc R
  1013. Next A
  1014. Close 1
  1015. '
  1016. ' ******** 
  1017. ' draw map 
  1018. ' ******** 
  1019. For D=0 To 12
  1020.    For A=0 To 19
  1021.       If MAP(A,D)>0
  1022.          Paste Bob A*16,D*16,MAP(A,D)+91
  1023.       End If 
  1024.       ' ************************************** 
  1025.       ' if a portal is found we need to assign 
  1026.       ' an AMAL channel to it so it animates 
  1027.       ' ************************************** 
  1028.       If MAP(A,D)=1
  1029.          Bob _PORTAL_COUNT,A*16,D*16,MAP(A,D)+91
  1030.          Channel _PORTAL_COUNT To Bob _PORTAL_COUNT
  1031.          Amal _PORTAL_COUNT,_PORTAL$
  1032.          Amal On _PORTAL_COUNT
  1033.          Inc _PORTAL_COUNT
  1034.       End If 
  1035.    Next A
  1036. Next D
  1037. '
  1038. Double Buffer 
  1039. '
  1040. ' *******************
  1041. ' set up status panel
  1042. ' *******************
  1043. If STATUS_SCREEN_ON=0
  1044.    Unpack 2 To 1
  1045.    Curs Off : Flash Off 
  1046.    Colour 0,$0
  1047.    Screen Display 1,128,254,320,48
  1048.    STATUS_SCREEN_ON=1
  1049. End If 
  1050. '
  1051. ' *****************************  
  1052. ' put numbers onto status panel  
  1053. ' *****************************  
  1054. STATUS_ENERGY
  1055. STATUS_LIVES
  1056. STATUS_BOMBS
  1057. STATUS_LEVEL
  1058. '
  1059. ' *****************************
  1060. ' display message - "let's go!"
  1061. ' *****************************
  1062. Bob 20,136,64,163
  1063. Bob 21,144,78,164
  1064. '
  1065. ' *****************
  1066. ' show baddy/player
  1067. ' *****************
  1068. Bob 15,BADDY_X(0),BADDY_Y(0),BADDY_FRAME(0)
  1069. Bob 16,BADDY_X(1),BADDY_Y(1),BADDY_FRAME(1)
  1070. Bob 17,BADDY_X(2),BADDY_Y(2),BADDY_FRAME(2)
  1071. Bob 18,BADDY_X(3),BADDY_Y(3),BADDY_FRAME(3)
  1072. Bob 19,_PLAYER_X,_PLAYER_Y,_PLAYER_FRAME
  1073. '
  1074. ' *****************
  1075. ' show both screens
  1076. ' *****************
  1077. Screen Show 0 : Screen Show 1
  1078. '
  1079. ' ****************** 
  1080. ' fade in big screen 
  1081. ' ****************** 
  1082. Screen 0
  1083. Fade 5 To -1,%1111111111111110
  1084. Wait 75
  1085. '
  1086. ' ************************** 
  1087. ' get rid of "let's go!" bit 
  1088. ' ************************** 
  1089. Bob Off 20 : Bob Off 21
  1090. '
  1091. Autoback 0 : Bob Update Off 
  1092. '
  1093. ' ******************** 
  1094. ' go to game main loop 
  1095. ' ******************** 
  1096. Goto _START_GAME
  1097. '
  1098. ' ---------------------------------------------------------------------
  1099. '
  1100. ' ************** 
  1101. ' LEVEL COMPLETE 
  1102. ' ************** 
  1103. LEVEL_COMPLETE:
  1104. ' *******************************************
  1105. ' set up extra screen which is coloured white
  1106. ' *******************************************
  1107. Screen Open 2,320,256,2,Lowres
  1108. Curs Off : Flash Off : Hide 
  1109. Screen Hide 2
  1110. Colour 0,$888
  1111. Colour 1,$AAA
  1112. Cls 1
  1113. '
  1114. ' ************************************ 
  1115. ' make the screen flash by switching 
  1116. ' between maze screen and white screen 
  1117. ' ************************************ 
  1118. For C=0 To 19
  1119.    Screen Hide 2
  1120.    Screen Show 0
  1121.    Wait 2
  1122.    Screen Hide 0
  1123.    Screen Show 2
  1124.    Wait Vbl 
  1125.    If SOUND=1
  1126.       Sam Raw 3,Start(10)+8212+5940,796,10000
  1127.    End If 
  1128. Next C
  1129. '
  1130. ' *******************
  1131. ' remove white screen
  1132. ' *******************
  1133. Screen Close 2
  1134. '
  1135. ' *******
  1136. ' tidy up
  1137. ' *******
  1138. Screen 0
  1139. Screen Show 0
  1140. Autoback 2
  1141. Bob Update On 
  1142. Amal Off 
  1143. For A=4 To 14 : Bob Off A : Next A
  1144. '
  1145. ' *****************************
  1146. ' display message - "well done"
  1147. ' *****************************  
  1148. For A=-40 To 142 Step 4
  1149.    Bob 20,A,64,165
  1150.    Wait 1
  1151. Next A
  1152. For A=360 To 136 Step -4
  1153.    Bob 21,A,78,166
  1154.    Wait 1
  1155. Next A
  1156. '
  1157. Wait 100
  1158. '
  1159. ' ******************** 
  1160. ' fade out main screen 
  1161. ' ******************** 
  1162. Fade 5 : Wait 75
  1163. '
  1164. ' ************************** 
  1165. ' remove "well done" message 
  1166. ' ************************** 
  1167. Bob Off 20 : Bob Off 21
  1168. '
  1169. Screen Close 0
  1170. '
  1171. ' ************************** 
  1172. ' calls this to add on score 
  1173. ' ************************** 
  1174. STATUS_SCORE
  1175. '
  1176. ' ************************************** 
  1177. ' have we completed all available levels 
  1178. ' ************************************** 
  1179. If LEVEL=LAST_LEVEL Then Goto FINISHED_GAME
  1180. '
  1181. ' *************************
  1182. ' if not go onto next level
  1183. ' *************************
  1184. Inc LEVEL
  1185. Goto NEW_LEVEL
  1186. '
  1187. ' ---------------------------------------------------------------------- 
  1188. '
  1189. ' *********
  1190. ' GAME OVER
  1191. ' *********
  1192. GAME_OVER:
  1193. ' *******
  1194. ' tidy up
  1195. ' *******
  1196. Screen 0
  1197. Screen Swap 
  1198. Amal Off 
  1199. For C=0 To 19 : Bob Off C : Next C
  1200. '
  1201. Autoback 1
  1202. '
  1203. ' *****************************
  1204. ' clear screen using box effect
  1205. ' *****************************
  1206. Wait 50
  1207. _BOX_COUNT=0
  1208. Repeat 
  1209.    Repeat 
  1210.       X=Rnd(19) : Y=Rnd(12)
  1211.    Until MAP(X,Y)<>-5
  1212.    Cls 0,X*16,Y*16 To(X*16)+16,(Y*16)+16
  1213.    MAP(X,Y)=-5
  1214.    Inc _BOX_COUNT
  1215. Until _BOX_COUNT=260
  1216. '
  1217. Wait 50
  1218. '
  1219. ' ************************ 
  1220. ' show message "game over" 
  1221. ' ************************ 
  1222. Bob 20,138,64,167
  1223. Bob 21,138,78,168
  1224. '
  1225. Wait 150
  1226. '
  1227. ' **************************** 
  1228. ' fade out "game over" message 
  1229. ' **************************** 
  1230. Fade 5 : Wait 75
  1231. '
  1232. ' *******
  1233. ' tidy up
  1234. ' *******
  1235. Screen Close 0
  1236. Screen 1
  1237. Fade 5 : Wait 75
  1238. Screen Close 1
  1239. '
  1240. ' *******************
  1241. ' back 2 title screen
  1242. ' *******************
  1243. Goto TITLE_SCREEN
  1244. '
  1245. ' -------------------------------------------------------------------
  1246. '
  1247. ' *************
  1248. ' FINISHED GAME
  1249. ' *************
  1250. FINISHED_GAME:
  1251. Wait 50
  1252. ' *************
  1253. ' set up screen
  1254. ' *************
  1255. Screen Open 0,320,200,16,Lowres
  1256. Curs Off : Flash Off 
  1257. '
  1258. ' **************** 
  1259. ' put colours to 0 
  1260. ' **************** 
  1261. For C=0 To 15 : Colour C,$0 : Next C
  1262. '
  1263. Cls 0 : Paper 0 : Pen 1
  1264. '
  1265. ' *********************************************
  1266. ' print message depending on how far player got
  1267. ' *********************************************
  1268. If LAST_LEVEL<20
  1269.    Locate 0,4 : Centre "-WELL DONE!- "
  1270.    Locate 0,5 : Centre "NOW IF YOU WANT TO SEE ANY"
  1271.    Locate 0,6 : Centre "MORE OF THIS GAME USE A HIGHER"
  1272.    Locate 0,7 : Centre "DIFFICULTY SETTING"
  1273. End If 
  1274. If LAST_LEVEL=20
  1275.    Locate 0,4 : Centre "-CONGRATULATIONS!!!-"
  1276.    Locate 0,5 : Centre "YOU HAVE COMPLETED PARTICLE MAN"
  1277.    Locate 0,6 : Centre "IF YOU ENJOYED THIS GAME"
  1278.    Locate 0,7 : Centre "WHY NOT SEND OFF FOR THE"
  1279.    Locate 0,8 : Centre "ENHANCED VERSION"
  1280.    Locate 0,9 : Centre "WHICH HAS NEW LEVELS"
  1281.    Locate 0,10 : Centre "AND MORE MAZE MONSTERS."
  1282. End If 
  1283. '
  1284. ' ***************
  1285. ' fade in message
  1286. ' ***************
  1287. Fade 5 To -1,%1111111111111110
  1288. '
  1289. ' *************
  1290. ' wait for fire
  1291. ' *************
  1292. Repeat 
  1293. Until Fire(1)
  1294. '
  1295. ' *********************  
  1296. ' fade out both screens
  1297. ' *********************  
  1298. Fade 5 : Wait 75
  1299. Screen Close 0
  1300. Screen 1
  1301. Fade 5 : Wait 75
  1302. Screen Close 1
  1303. '
  1304. ' ************************ 
  1305. ' and back to title screen 
  1306. ' ************************ 
  1307. Goto TITLE_SCREEN
  1308. '
  1309. ' -------------------------------------------------------------
  1310. '
  1311. Procedure MOVE_PLAYER
  1312.    If _PLAYER_STATE<2
  1313.       ' ************** 
  1314.       ' reads joystick 
  1315.       ' ************** 
  1316.       ' ** 
  1317.       ' up 
  1318.       ' ** 
  1319.       If(Joy(1)=1 or Joy(1)=17) and MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y-1)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y-1)/16))<WALL_START
  1320.          _PLAYER_DIRECTION=0
  1321.       End If 
  1322.       ' *****
  1323.       ' right
  1324.       ' *****
  1325.       If(Joy(1)=8 or Joy(1)=24) and MAP(Int(_PLAYER_X+16)/16,Int(_PLAYER_Y/16))<WALL_START and MAP(Int(_PLAYER_X+16)/16,Int((_PLAYER_Y+15)/16))<WALL_START
  1326.          _PLAYER_DIRECTION=2
  1327.       End If 
  1328.       ' **** 
  1329.       ' down 
  1330.       ' **** 
  1331.       If(Joy(1)=2 or Joy(1)=18) and MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y+16)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+16)/16))<WALL_START
  1332.          _PLAYER_DIRECTION=4
  1333.       End If 
  1334.       ' **** 
  1335.       ' left 
  1336.       ' **** 
  1337.       If(Joy(1)=4 or Joy(1)=20) and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y)/16))<WALL_START and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y+15)/16))<WALL_START
  1338.          _PLAYER_DIRECTION=6
  1339.       End If 
  1340.       ' *****************************************
  1341.       ' checks diagonal movement if option chosen
  1342.       ' *****************************************
  1343.       If DIAGONAL=1
  1344.          ' ******** 
  1345.          ' up-right 
  1346.          ' ******** 
  1347.          If(Joy(1)=9 or Joy(1)=25)
  1348.             _PLAYER_DIRECTION=1
  1349.          End If 
  1350.          ' *********
  1351.          ' down-right 
  1352.          ' *********
  1353.          If(Joy(1)=10 or Joy(1)=26)
  1354.             _PLAYER_DIRECTION=3
  1355.          End If 
  1356.          ' *********
  1357.          ' down-left
  1358.          ' *********
  1359.          If(Joy(1)=6 or Joy(1)=22)
  1360.             _PLAYER_DIRECTION=5
  1361.          End If 
  1362.          ' *******
  1363.          ' up-left
  1364.          ' *******
  1365.          If(Joy(1)=5 or Joy(1)=21)
  1366.             _PLAYER_DIRECTION=7
  1367.          End If 
  1368.          ' ********************************** 
  1369.          ' if joystick not moved we try and 
  1370.          ' change direction to a non-diagonal 
  1371.          ' ********************************** 
  1372.          If(Joy(1)=0 or Joy(1)=16)
  1373.             ' ** 
  1374.             ' up 
  1375.             ' ** 
  1376.             If(_PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=7) and MAP(Int(_PLAYER_X)/16,Int((_PLAYER_Y-1)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y-1)/16))<WALL_START
  1377.                _PLAYER_DIRECTION=0
  1378.             End If 
  1379.             ' **** 
  1380.             ' down 
  1381.             ' **** 
  1382.             If(_PLAYER_DIRECTION=3 or _PLAYER_DIRECTION=5) and MAP(Int(_PLAYER_X)/16,Int((_PLAYER_Y+16)/16))<WALL_START and MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+16)/16))<WALL_START
  1383.                _PLAYER_DIRECTION=4
  1384.             End If 
  1385.             ' *****  
  1386.             ' right  
  1387.             ' *****
  1388.             If(_PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=3) and MAP(Int(_PLAYER_X+16)/16,Int(_PLAYER_Y/16))<WALL_START and MAP(Int(_PLAYER_X+16)/16,Int((_PLAYER_Y+15)/16))<WALL_START
  1389.                _PLAYER_DIRECTION=2
  1390.             End If 
  1391.             ' **** 
  1392.             ' left   
  1393.             ' **** 
  1394.             If(_PLAYER_DIRECTION=5 or _PLAYER_DIRECTION=7) and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y)/16))<WALL_START and MAP(Int(_PLAYER_X-1)/16,Int((_PLAYER_Y+15)/16))<WALL_START
  1395.                _PLAYER_DIRECTION=6
  1396.             End If 
  1397.          End If 
  1398.       End If 
  1399.       ' *******************************************  
  1400.       ' test for arrow squares before moving player
  1401.       ' if player has crossed an arrow square
  1402.       ' direction is changed to opposite of arrow
  1403.       ' *******************************************  
  1404.       ' ******** 
  1405.       ' up-arrow 
  1406.       ' ******** 
  1407.       If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=13
  1408.          _PLAYER_DIRECTION=0
  1409.       End If 
  1410.       ' ***********
  1411.       ' right-arrow
  1412.       ' ***********
  1413.       If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=14
  1414.          _PLAYER_DIRECTION=2
  1415.       End If 
  1416.       ' ********** 
  1417.       ' down-arrow 
  1418.       ' ********** 
  1419.       If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=15
  1420.          _PLAYER_DIRECTION=4
  1421.       End If 
  1422.       ' ********** 
  1423.       ' left-arrow 
  1424.       ' ********** 
  1425.       If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=16
  1426.          _PLAYER_DIRECTION=6
  1427.       End If 
  1428.       ' ***********  
  1429.       ' move player  
  1430.       ' ***********  
  1431.       ' ** 
  1432.       ' up 
  1433.       ' ** 
  1434.       If _PLAYER_DIRECTION=0 or _PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=7
  1435.          ' ************** 
  1436.          ' animate player 
  1437.          ' ************** 
  1438.          ' ***********
  1439.          ' normal mode
  1440.          ' ***********
  1441.          If _PLAYER_STATE=0 and _PLAYER_DIRECTION=0 and _PLAYER_FRAME_DELAY=0
  1442.             Add _PLAYER_FRAME,1,13 To 16
  1443.          End If 
  1444.          ' ***********
  1445.          ' absorb mode
  1446.          ' ***********
  1447.          If _PLAYER_STATE=1 and _PLAYER_DIRECTION=0 and _PLAYER_FRAME_DELAY=0
  1448.             Add _PLAYER_FRAME,1,34 To 37
  1449.          End If 
  1450.          ' ***********
  1451.          ' move player
  1452.          ' ***********
  1453.          Add _PLAYER_Y,-_PLAYER_SPEED
  1454.          ' *************
  1455.          ' test for wall
  1456.          ' *************
  1457.          If MAP(Int(_PLAYER_X/16),Int(_PLAYER_Y/16))>=WALL_START or MAP(Int(_PLAYER_X+15)/16,Int(_PLAYER_Y/16))>=WALL_START
  1458.             Add _PLAYER_Y,_PLAYER_SPEED
  1459.          End If 
  1460.       End If 
  1461.       ' **** 
  1462.       ' down 
  1463.       ' **** 
  1464.       If _PLAYER_DIRECTION=4 or _PLAYER_DIRECTION=3 or _PLAYER_DIRECTION=5
  1465.          ' ************** 
  1466.          ' animate player 
  1467.          ' ************** 
  1468.          ' ***********
  1469.          ' normal mode  
  1470.          ' ***********
  1471.          If _PLAYER_STATE=0 and _PLAYER_DIRECTION=4 and _PLAYER_FRAME_DELAY=0
  1472.             Add _PLAYER_FRAME,1,9 To 12
  1473.          End If 
  1474.          ' ***********
  1475.          ' absorb mode
  1476.          ' ***********
  1477.          If _PLAYER_STATE=1 and _PLAYER_DIRECTION=4 and _PLAYER_FRAME_DELAY=0
  1478.             Add _PLAYER_FRAME,1,30 To 33
  1479.          End If 
  1480.          ' ***********
  1481.          ' move player
  1482.          ' ***********
  1483.          Add _PLAYER_Y,_PLAYER_SPEED
  1484.          ' *************
  1485.          ' test for wall
  1486.          ' *************
  1487.          If MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y+15)/16))>=WALL_START or MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+15)/16))>=WALL_START
  1488.             Add _PLAYER_Y,-_PLAYER_SPEED
  1489.          End If 
  1490.       End If 
  1491.       ' *****
  1492.       ' right
  1493.       ' *****
  1494.       If _PLAYER_DIRECTION=2 or _PLAYER_DIRECTION=1 or _PLAYER_DIRECTION=3
  1495.          ' ************** 
  1496.          ' animate player 
  1497.          ' ************** 
  1498.          ' ***********
  1499.          ' normal mode
  1500.          ' ***********
  1501.          If _PLAYER_STATE=0 and _PLAYER_FRAME_DELAY=0
  1502.             Add _PLAYER_FRAME,1,1 To 4
  1503.          End If 
  1504.          ' ***********
  1505.          ' absorb mode
  1506.          ' ***********
  1507.          If _PLAYER_STATE=1 and _PLAYER_FRAME_DELAY=0
  1508.             Add _PLAYER_FRAME,1,22 To 25
  1509.          End If 
  1510.          ' ***********
  1511.          ' move player
  1512.          ' ***********
  1513.          Add _PLAYER_X,_PLAYER_SPEED
  1514.          ' *************
  1515.          ' test for wall
  1516.          ' *************
  1517.          If MAP(Int(_PLAYER_X+15)/16,Int(_PLAYER_Y/16))>=WALL_START or MAP(Int(_PLAYER_X+15)/16,Int((_PLAYER_Y+15)/16))>=WALL_START
  1518.             Add _PLAYER_X,-_PLAYER_SPEED
  1519.          End If 
  1520.       End If 
  1521.       ' **** 
  1522.       ' left 
  1523.       ' **** 
  1524.       If _PLAYER_DIRECTION=6 or _PLAYER_DIRECTION=5 or _PLAYER_DIRECTION=7
  1525.          ' ************** 
  1526.          ' animate player 
  1527.          ' ************** 
  1528.          ' ***********
  1529.          ' normal mode  
  1530.          ' ***********
  1531.          If _PLAYER_STATE=0 and _PLAYER_FRAME_DELAY=0
  1532.             Add _PLAYER_FRAME,1,5 To 8
  1533.          End If 
  1534.          ' ***********
  1535.          ' absorb mode
  1536.          ' ***********
  1537.          If _PLAYER_STATE=1 and _PLAYER_FRAME_DELAY=0
  1538.             Add _PLAYER_FRAME,1,26 To 29
  1539.          End If 
  1540.          ' ***********
  1541.          ' move player
  1542.          ' ***********
  1543.          Add _PLAYER_X,-_PLAYER_SPEED
  1544.          ' *************
  1545.          ' test for wall
  1546.          ' *************
  1547.          If MAP(Int(_PLAYER_X)/16,Int(_PLAYER_Y/16))>=WALL_START or MAP(Int(_PLAYER_X/16),Int((_PLAYER_Y+15)/16))>=WALL_START
  1548.             Add _PLAYER_X,_PLAYER_SPEED
  1549.          End If 
  1550.       End If 
  1551.       Add _PLAYER_FRAME_DELAY,1,0 To 1
  1552.       ' ************************************ 
  1553.       ' has player collided with a monster ? 
  1554.       ' ************************************ 
  1555.       If Bob Col(19,15 To 18)
  1556.          ' *****************************************  
  1557.          ' yes we have collided 
  1558.          ' so if we are holding a bomb get rid of it  
  1559.          ' *****************************************  
  1560.          If _PLAYER_STATE=1
  1561.             ' ********************************** 
  1562.             ' find out which bomb we are holding 
  1563.             ' ********************************** 
  1564.             For COUNT=0 To 4
  1565.                ' ****************************** 
  1566.                ' this is the one we are holding 
  1567.                ' ****************************** 
  1568.                If BOMB_STATE(COUNT)=3
  1569.                   ' ******************** 
  1570.                   ' make it non-existant 
  1571.                   ' ******************** 
  1572.                   BOMB_STATE(COUNT)=0
  1573.                End If 
  1574.             Next COUNT
  1575.             ' ****************************** 
  1576.             ' reduce number of bombs in maze 
  1577.             ' ****************************** 
  1578.             Dec BOMBS_ON
  1579.          End If 
  1580.          ' ************************ 
  1581.          ' set player mode to dying 
  1582.          ' ************************ 
  1583.          _PLAYER_STATE=2
  1584.          ' *********************
  1585.          ' and get correct frame
  1586.          ' *********************
  1587.          _PLAYER_FRAME=43
  1588.          ' *******************************
  1589.          ' aaaarrrrrrgggggghhhhhh!!!!!!!!!
  1590.          ' *******************************
  1591.          If SOUND=1
  1592.             Sam Raw 3,Start(10)+8212,5940,10000
  1593.          End If 
  1594.       End If 
  1595.       ' *************************************
  1596.       ' has player dropped bomb down portal ?
  1597.       ' *************************************
  1598.       If MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=1 and _PLAYER_STATE=1
  1599.          ' ***********************************  
  1600.          ' yes so find the bomb we are holding  
  1601.          ' ***********************************  
  1602.          For COUNT=0 To 4
  1603.             ' ****************************** 
  1604.             ' this is the one we are holding 
  1605.             ' ****************************** 
  1606.             If BOMB_STATE(COUNT)=3
  1607.                ' ******************************** 
  1608.                ' so change it's state to indicate 
  1609.                ' it is dropping down portal 
  1610.                ' ******************************** 
  1611.                BOMB_STATE(COUNT)=4
  1612.                ' ****************************** 
  1613.                ' and get correct starting frame 
  1614.                ' ****************************** 
  1615.                BOMB_FRAME(COUNT)=88
  1616.                ' *****************************
  1617.                ' align bomb relative to portal
  1618.                ' *****************************
  1619.                BOMB_X(COUNT)=(Int(_PLAYER_X+7)/16)*16
  1620.                BOMB_Y(COUNT)=(Int(_PLAYER_Y+7)/16)*16
  1621.             End If 
  1622.          Next COUNT
  1623.          ' ******************************** 
  1624.          ' change player back 2 normal mode 
  1625.          ' ******************************** 
  1626.          _PLAYER_STATE=0
  1627.          ' ***************************************************
  1628.          ' noise to indicate bomb has been dropped into portal
  1629.          ' ***************************************************
  1630.          If SOUND=1
  1631.             Sam Raw 3,Start(10)+8212+5940,796,10000
  1632.          End If 
  1633.          ' *****************************************************
  1634.          ' reduce bombs needed to dispose of and show new amount
  1635.          ' *****************************************************
  1636.          Dec BOMBS_TO_COLLECT
  1637.          STATUS_BOMBS
  1638.       End If 
  1639.       ' *******************************************************  
  1640.       ' has player dropped bomb somewhere other than a portal ?
  1641.       ' *******************************************************  
  1642.       If _PLAYER_STATE=1 and(MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))>=FLOOR_START or MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))=0) and MAP(Int((_PLAYER_X+7)/16),Int((_PLAYER_Y+7)/16))<WALL_START and Not Fire(1)
  1643.          ' ********************************** 
  1644.          ' yes so find which bomb was dropped 
  1645.          ' ********************************** 
  1646.          For COUNT=0 To 4
  1647.             ' ********************************** 
  1648.             ' this is the one i.e bomb state = 3 
  1649.             ' ********************************** 
  1650.             If BOMB_STATE(COUNT)=3
  1651.                ' ********************** 
  1652.                ' align bomb within maze 
  1653.                ' ********************** 
  1654.                BOMB_X(COUNT)=(Int((_PLAYER_X+7))/16)*16
  1655.                BOMB_Y(COUNT)=(Int((_PLAYER_Y+7))/16)*16
  1656.                ' ************************************************** 
  1657.                ' update maze map so we know there is a bomb in this 
  1658.                ' part of maze 
  1659.                ' ************************************************** 
  1660.                MAP(Int(_PLAYER_X+7)/16,Int(_PLAYER_Y+7)/16)=-1
  1661.                ' ****************************** 
  1662.                ' put bomb state into decay mode 
  1663.                ' ****************************** 
  1664.                BOMB_STATE(COUNT)=1
  1665.                ' ******************** 
  1666.                ' restore bomb's timer 
  1667.                ' ******************** 
  1668.                BOMB_DECAY(COUNT)=BOMB_DECAY_RATE
  1669.                ' **************************** 
  1670.                ' return player to normal mode 
  1671.                ' **************************** 
  1672.                _PLAYER_STATE=0
  1673.             End If 
  1674.          Next COUNT
  1675.       End If 
  1676.    End If 
  1677.    ' *****************
  1678.    ' is player dying ?
  1679.    ' *****************
  1680.    If _PLAYER_STATE=2
  1681.       ' ************************ 
  1682.       ' does the dying animation 
  1683.       ' ************************ 
  1684.       If _PLAYER_FRAME_DELAY=0
  1685.          Add _PLAYER_FRAME,1
  1686.          Wait Vbl 
  1687.       End If 
  1688.       Add _PLAYER_FRAME_DELAY,1,0 To 4
  1689.       '
  1690.       ' *******************************************  
  1691.       ' come here when dying animation has finished
  1692.       ' *******************************************
  1693.       If _PLAYER_FRAME>50
  1694.          If LIVES>0
  1695.             Wait 50
  1696.             ' *************
  1697.             ' fade out maze
  1698.             ' *************
  1699.             Fade 5
  1700.             Wait 75
  1701.             ' *************************
  1702.             ' remove all bobs from maze
  1703.             ' *************************
  1704.             For A=4 To 14 : Bob Off A : Next A
  1705.             Screen Swap 
  1706.             Wait Vbl 
  1707.             For A=4 To 14 : Bob Off A : Next A
  1708.             Screen Swap 
  1709.             ' ******************** 
  1710.             ' restore player stuff 
  1711.             ' ******************** 
  1712.             _PLAYER_STATE=0
  1713.             _PLAYER_DIRECTION=8
  1714.             _PLAYER_X=_PLAYER_X_COPY
  1715.             _PLAYER_Y=_PLAYER_Y_COPY
  1716.             _PLAYER_FRAME=9
  1717.             ' *******************
  1718.             ' restore baddy stuff
  1719.             ' *******************
  1720.             For A=0 To 3
  1721.                BADDY_X(A)=BADDY_X_COPY(A)
  1722.                BADDY_Y(A)=BADDY_Y_COPY(A)
  1723.             Next A
  1724.             ' ****************************************** 
  1725.             ' remove bombs and clear map where they were 
  1726.             ' ****************************************** 
  1727.             For A=0 To 4
  1728.                BOMB_STATE(A)=0
  1729.                If MAP(Int(BOMB_X(A))/16,Int(BOMB_Y(A))/16)<>1 and MAP(Int(BOMB_X(A))/16,Int(BOMB_Y(A))/16)<WALL_START
  1730.                   MAP(Int(BOMB_X(A))/16,Int(BOMB_Y(A))/16)=0
  1731.                End If 
  1732.             Next A
  1733.             ' ************************ 
  1734.             ' no bombs are now in maze 
  1735.             ' ************************ 
  1736.             BOMBS_ON=0
  1737.             ' *******************************
  1738.             ' restore timer that decides when  
  1739.             ' to allow monster to drop bomb
  1740.             ' *******************************
  1741.             DROP_DELAY=DROP_DELAY_MAX
  1742.             Wait 10
  1743.          End If 
  1744.          ' *********************************
  1745.          ' reduce lives and print new amount
  1746.          ' *********************************
  1747.          Dec LIVES
  1748.          STATUS_LIVES
  1749.          ' ********************************** 
  1750.          ' reduce energy and print new amount 
  1751.          ' ********************************** 
  1752.          ENERGY=3
  1753.          STATUS_ENERGY
  1754.          ' ****************************************** 
  1755.          ' if we are still alive have another attempt 
  1756.          ' ****************************************** 
  1757.          If LIVES>-1
  1758.             Wait 50
  1759.             Bob Clear 
  1760.             ' ************************** 
  1761.             ' put baddies back into maze 
  1762.             ' ************************** 
  1763.             For A=0 To 3
  1764.                Bob A+15,BADDY_X(A),BADDY_Y(A),BADDY_FRAME(A)
  1765.             Next A
  1766.             ' *************************
  1767.             ' put player back into maze
  1768.             ' *************************
  1769.             Bob 19,_PLAYER_X,_PLAYER_Y,_PLAYER_FRAME
  1770.             ' ********************** 
  1771.             ' show message "lets go" 
  1772.             ' ********************** 
  1773.             Bob 20,136,64,163
  1774.             Bob 21,144,78,164
  1775.             Bob Draw 
  1776.             Screen Swap 
  1777.             Wait Vbl 
  1778.             ' *******************
  1779.             ' fade in maze screen
  1780.             ' *******************
  1781.             Fade 5 To -1,%1111111111111110
  1782.             Wait 100
  1783.             ' ************************ 
  1784.             ' remove message "lets go" 
  1785.             ' ************************ 
  1786.             Bob Off 20 : Bob Off 21
  1787.             '
  1788.             _PORTAL_COUNT=0
  1789.          End If 
  1790.       End If 
  1791.    End If 
  1792.    Bob 19,_PLAYER_X,_PLAYER_Y,_PLAYER_FRAME
  1793. End Proc
  1794. Procedure MOVE_BADDY
  1795.    For COUNT=0 To 3
  1796.       ' ** 
  1797.       ' up 
  1798.       ' ** 
  1799.       If BADDY_DIRECTION(COUNT)=0
  1800.          Add BADDY_Y(COUNT),-BADDY_SPEED
  1801.          ' ****************************************** 
  1802.          ' reduce baddy steps 
  1803.          ' when = 0 baddy will choose a new direction 
  1804.          ' ****************************************** 
  1805.          Dec BADDY_STEP(COUNT)
  1806.          ' *************************
  1807.          ' see if baddy has hit wall
  1808.          ' *************************
  1809.          If MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))>=WALL_START or MAP(Int(BADDY_X(COUNT)+15)/16,Int(BADDY_Y(COUNT)/16))>=WALL_START
  1810.             ' ***********************************************************
  1811.             ' if yes we reduce its steps to 0 and it gets a new direction
  1812.             ' ***********************************************************
  1813.             Add BADDY_Y(COUNT),BADDY_SPEED
  1814.             BADDY_STEP(COUNT)=0
  1815.          End If 
  1816.       End If 
  1817.       ' *****
  1818.       ' right
  1819.       ' *****
  1820.       If BADDY_DIRECTION(COUNT)=1
  1821.          Add BADDY_X(COUNT),BADDY_SPEED
  1822.          ' ****************************************** 
  1823.          ' reduce baddy steps 
  1824.          ' when = 0 baddy will choose a new direction 
  1825.          ' ****************************************** 
  1826.          Dec BADDY_STEP(COUNT)
  1827.          ' *************************
  1828.          ' see if baddy has hit wall
  1829.          ' *************************
  1830.          If MAP(Int(BADDY_X(COUNT)+15)/16,Int(BADDY_Y(COUNT)/16))>=WALL_START or MAP(Int(BADDY_X(COUNT)+15)/16,Int((BADDY_Y(COUNT)+15)/16))>=WALL_START
  1831.             ' ***********************************************************
  1832.             ' if yes we reduce its steps to 0 and it gets a new direction
  1833.             ' ***********************************************************
  1834.             Add BADDY_X(COUNT),-BADDY_SPEED
  1835.             BADDY_STEP(COUNT)=0
  1836.          End If 
  1837.       End If 
  1838.       ' **** 
  1839.       ' down 
  1840.       ' **** 
  1841.       If BADDY_DIRECTION(COUNT)=2
  1842.          Add BADDY_Y(COUNT),BADDY_SPEED
  1843.          ' ****************************************** 
  1844.          ' reduce baddy steps 
  1845.          ' when = 0 baddy will choose a new direction 
  1846.          ' ****************************************** 
  1847.          Dec BADDY_STEP(COUNT)
  1848.          ' *************************
  1849.          ' see if baddy has hit wall
  1850.          ' *************************
  1851.          If MAP(Int(BADDY_X(COUNT)/16),Int((BADDY_Y(COUNT)+15)/16))>=WALL_START or MAP(Int(BADDY_X(COUNT)+15)/16,Int((BADDY_Y(COUNT)+15)/16))>=WALL_START
  1852.             ' ***********************************************************
  1853.             ' if yes we reduce its steps to 0 and it gets a new direction
  1854.             ' ***********************************************************
  1855.             Add BADDY_Y(COUNT),-BADDY_SPEED
  1856.             BADDY_STEP(COUNT)=0
  1857.          End If 
  1858.       End If 
  1859.       ' **** 
  1860.       ' left 
  1861.       ' **** 
  1862.       If BADDY_DIRECTION(COUNT)=3
  1863.          Add BADDY_X(COUNT),-BADDY_SPEED
  1864.          ' ****************************************** 
  1865.          ' reduce baddy steps 
  1866.          ' when = 0 baddy will choose a new direction 
  1867.          ' ****************************************** 
  1868.          Dec BADDY_STEP(COUNT)
  1869.          ' *************************
  1870.          ' see if baddy has hit wall
  1871.          ' *************************
  1872.          If MAP(Int(BADDY_X(COUNT))/16,Int((BADDY_Y(COUNT)/16)))>=WALL_START or MAP(Int(BADDY_X(COUNT)/16),Int((BADDY_Y(COUNT)+15)/16))>=WALL_START
  1873.             ' ***********************************************************
  1874.             ' if yes we reduce its steps to 0 and it gets a new direction
  1875.             ' ***********************************************************
  1876.             Add BADDY_X(COUNT),BADDY_SPEED
  1877.             BADDY_STEP(COUNT)=0
  1878.          End If 
  1879.       End If 
  1880.       '
  1881.       ' ***************
  1882.       ' animate monster
  1883.       ' ***************
  1884.       Add BADDY_FRAME(COUNT),1,BADDY_FRAME_START(COUNT) To BADDY_FRAME_START(COUNT)+3
  1885.       '
  1886.       ' ***********************************************************
  1887.       ' get a new direction for monster if its "steps" have run out  
  1888.       ' ***********************************************************
  1889.       If BADDY_STEP(COUNT)=0
  1890.          BADDY_DIRECTION(COUNT)=Rnd(3)
  1891.          BADDY_STEP(COUNT)=(Rnd(3)+1)*16
  1892.       End If 
  1893.       '
  1894.       ' *******************************************************
  1895.       ' reduce timer that determines when monster can drop bomb
  1896.       ' *******************************************************
  1897.       Dec DROP_DELAY
  1898.       '
  1899.       ' *********************************
  1900.       ' is monster allowed to drop bomb ?
  1901.       ' *********************************
  1902.       If DROP_DELAY<=0 and BOMBS_ON<5 and((MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))=0 or MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))>=FLOOR_START) and MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))<WALL_START)
  1903.          If Rnd(3)=2
  1904.             ' ***************************  
  1905.             ' yes so put a bomb into maze  
  1906.             ' ***************************  
  1907.             CHOSEN=0
  1908.             ' ************************************** 
  1909.             ' find a bomb that isn't already in maze 
  1910.             ' state = 0
  1911.             ' ************************************** 
  1912.             For C=0 To 4
  1913.                ' ***********************************
  1914.                ' can use this one i.e bomb state = 0
  1915.                ' ***********************************
  1916.                If BOMB_STATE(C)=0 and CHOSEN=0
  1917.                   ' ***********************************************
  1918.                   ' change bomb state to indicate it is now in maze
  1919.                   ' ***********************************************
  1920.                   BOMB_STATE(C)=1
  1921.                   ' **************************************************** 
  1922.                   ' give bomb co-ords which are taken from baddy co-ords 
  1923.                   ' **************************************************** 
  1924.                   BOMB_X(C)=Int(BADDY_X(COUNT)/16)*16
  1925.                   BOMB_Y(C)=Int(BADDY_Y(COUNT)/16)*16
  1926.                   ' **************** 
  1927.                   ' set bomb's timer 
  1928.                   ' **************** 
  1929.                   BOMB_DECAY(C)=BOMB_DECAY_RATE
  1930.                   ' ***********************************************
  1931.                   ' update maze map so we know there is a bomb here
  1932.                   ' ***********************************************
  1933.                   MAP(Int(BADDY_X(COUNT)/16),Int(BADDY_Y(COUNT)/16))=-1
  1934.                   ' *************************************************
  1935.                   ' set this to 1 so we don't drop more than one bomb
  1936.                   ' *************************************************
  1937.                   CHOSEN=1
  1938.                End If 
  1939.             Next C
  1940.             ' ****************************************** 
  1941.             ' increase "number of bombs in maze" counter 
  1942.             ' ****************************************** 
  1943.             Inc BOMBS_ON
  1944.             ' **************************************************************** 
  1945.             ' restore timer that controls how fast bombs can be placed in maze 
  1946.             ' **************************************************************** 
  1947.             DROP_DELAY=DROP_DELAY_MAX
  1948.          End If 
  1949.       End If 
  1950.       ' ************************ 
  1951.       ' draw monster onto screen 
  1952.       ' ************************ 
  1953.       Bob 15+COUNT,BADDY_X(COUNT),BADDY_Y(COUNT),BADDY_FRAME(COUNT)
  1954.    Next COUNT
  1955. End Proc
  1956. Procedure BOMB
  1957.    For COUNT=0 To 4
  1958.       ' ************************************************************ 
  1959.       ' reduce bomb timer if it is in maze and has not been absorbed 
  1960.       ' ************************************************************ 
  1961.       If BOMB_STATE(COUNT)>0 and BOMB_STATE(COUNT)<3
  1962.          Dec BOMB_DECAY(COUNT)
  1963.          ' ***********************************************
  1964.          ' deals with bombs before they start to flash
  1965.          ' works out how far the timer has been reduced by
  1966.          ' and selects appropriate frame
  1967.          ' ***********************************************
  1968.          If BOMB_DECAY(COUNT)>BOMB_DECAY_RATE*0.5
  1969.             BOMB_STATE(COUNT)=1
  1970.             If BOMB_DECAY(COUNT)>=BOMB_DECAY_RATE*0.8
  1971.                Add BOMB_FRAME(COUNT),1,75 To 76
  1972.             End If 
  1973.             If BOMB_DECAY(COUNT)>=BOMB_DECAY_RATE*0.7 and BOMB_DECAY(COUNT)<BOMB_DECAY_RATE*0.8
  1974.                Add BOMB_FRAME(COUNT),1,81 To 82
  1975.             End If 
  1976.             If BOMB_DECAY(COUNT)>=BOMB_DECAY_RATE*0.5 and BOMB_DECAY(COUNT)<BOMB_DECAY_RATE*0.7
  1977.                Add BOMB_FRAME(COUNT),1,85 To 86
  1978.             End If 
  1979.          End If 
  1980.          ' ***************************************
  1981.          ' make bomb flash as its timer is =< half  
  1982.          ' ***************************************
  1983.          If BOMB_DECAY(COUNT)=<BOMB_DECAY_RATE*0.5
  1984.             BOMB_STATE(COUNT)=2
  1985.             Add BOMB_FRAME(COUNT),1,86 To 87
  1986.          End If 
  1987.          ' ***************************************
  1988.          ' timer has run out so blow the bugger up
  1989.          ' ***************************************
  1990.          If BOMB_DECAY(COUNT)=0
  1991.             ' *********************
  1992.             ' bomb no longer exists
  1993.             ' *********************
  1994.             BOMB_STATE(COUNT)=0
  1995.             ' ************************ 
  1996.             ' clear map where bomb was 
  1997.             ' ************************ 
  1998.             MAP(Int(BOMB_X(COUNT)/16),Int(BOMB_Y(COUNT)/16))=0
  1999.             ' *************************
  2000.             ' one less bomb in maze now
  2001.             ' *************************
  2002.             Dec BOMBS_ON
  2003.             ' ********************** 
  2004.             ' boooooommmmmmm!!!!!!!! 
  2005.             ' ********************** 
  2006.             If SOUND=1
  2007.                Sam Raw 3,Start(10),8000,10000
  2008.             End If 
  2009.             ' ********************** 
  2010.             ' this shakes the screen 
  2011.             ' ********************** 
  2012.             For NUMBER_OF_SHAKES=0 To 19
  2013.                For A=128 To 32 Step -16
  2014.                   Screen Display 0,A,45,,
  2015.                Next A
  2016.                For A=100 To 224 Step 16
  2017.                   Screen Display 0,A,45,,
  2018.                Next A
  2019.             Next NUMBER_OF_SHAKES
  2020.             ' ********************************** 
  2021.             ' put screen back to normal position 
  2022.             ' ********************************** 
  2023.             Screen Display 0,128,45,,
  2024.             ' ************************************ 
  2025.             ' lose some energy and show new amount 
  2026.             ' ************************************ 
  2027.             Dec ENERGY
  2028.             STATUS_ENERGY
  2029.          End If 
  2030.          ' *******************************************************  
  2031.          ' has player collided with bomb and pressed fire button ?  
  2032.          ' i.e can we absorb bomb ? 
  2033.          ' *******************************************************  
  2034.          If Bob Col(19,4+COUNT To 4+COUNT) and _PLAYER_STATE=0 and Fire(1) and Abs(_PLAYER_X-BOMB_X(COUNT))<7 and Abs(_PLAYER_Y-BOMB_Y(COUNT))<7
  2035.             ' ***
  2036.             ' yes
  2037.             ' ***
  2038.             ' ***************************************************
  2039.             ' clear map where bomb was as we have now absorbed it
  2040.             ' ***************************************************
  2041.             MAP(Int(BOMB_X(COUNT)/16),Int(BOMB_Y(COUNT)/16))=0
  2042.             ' ********************************** 
  2043.             ' change player state to absorb mode 
  2044.             ' ********************************** 
  2045.             _PLAYER_STATE=1
  2046.             ' ********************************** 
  2047.             ' change bomb state to absorbed mode 
  2048.             ' ********************************** 
  2049.             BOMB_STATE(COUNT)=3
  2050.             ' ************ 
  2051.             ' make a noise 
  2052.             ' ************ 
  2053.             If SOUND=1
  2054.                Sam Raw 3,Start(9),7600,40000
  2055.             End If 
  2056.          End If 
  2057.       End If 
  2058.       ' ***************
  2059.       ' down the portal
  2060.       ' ***************
  2061.       If BOMB_STATE(COUNT)=4
  2062.          If BOMB_FRAME_DELAY=0
  2063.             Add BOMB_FRAME(COUNT),1
  2064.          End If 
  2065.          Add BOMB_FRAME_DELAY,1,0 To 4
  2066.          ' ***********************************************************
  2067.          ' bomb has completed drop down portal so it now doesn't exist
  2068.          ' ***********************************************************
  2069.          If BOMB_FRAME(COUNT)=92
  2070.             BOMB_STATE(COUNT)=0
  2071.             ' *********************
  2072.             ' one less bomb in maze
  2073.             ' *********************
  2074.             Dec BOMBS_ON
  2075.             DROP_DELAY=DROP_DELAY_MAX
  2076.          End If 
  2077.       End If 
  2078.       ' *************************************************  
  2079.       ' print bomb if it exists and has not been absorbed
  2080.       ' *************************************************
  2081.       If BOMB_STATE(COUNT)>0 and BOMB_STATE(COUNT)<>3
  2082.          Bob 4+COUNT,BOMB_X(COUNT),BOMB_Y(COUNT),BOMB_FRAME(COUNT)
  2083.       Else 
  2084.          ' *******************************************************************************************************************
  2085.          ' if it doesn't exist we print it to the bottom part of screen which is not visible-this will keep speed of game same
  2086.          ' *******************************************************************************************************************
  2087.          Bob 4+COUNT,COUNT*16,209,BOMB_FRAME(COUNT)
  2088.       End If 
  2089.    Next COUNT
  2090. End Proc
  2091. Procedure STATUS_LIVES
  2092.    ' *********************
  2093.    ' print to panel screen
  2094.    ' ********************** 
  2095.    Screen 1
  2096.    If LIVES>9
  2097.       Paste Bob 75,16,151+Int(LIVES/10)
  2098.       Paste Bob 85,16,151+(LIVES-Int((LIVES/10)*10))
  2099.    End If 
  2100.    If LIVES<10 and LIVES>-1
  2101.       Paste Bob 75,16,151
  2102.       Paste Bob 85,16,151+LIVES
  2103.    End If 
  2104.    ' *******************************
  2105.    ' send output back to main screen
  2106.    ' *******************************
  2107.    Screen 0
  2108. End Proc
  2109. Procedure STATUS_BOMBS
  2110.    ' *********************
  2111.    ' print to panel screen
  2112.    ' *********************
  2113.    Screen 1
  2114.    If BOMBS_TO_COLLECT>9
  2115.       Paste Bob 209,16,151+Int(BOMBS_TO_COLLECT/10)
  2116.       Paste Bob 219,16,151+(BOMBS_TO_COLLECT-Int((BOMBS_TO_COLLECT/10)*10))
  2117.    End If 
  2118.    If BOMBS_TO_COLLECT<10
  2119.       Paste Bob 209,16,151
  2120.       Paste Bob 219,16,151+BOMBS_TO_COLLECT
  2121.    End If 
  2122.    ' ************************************************ 
  2123.    ' if all bombs disposed of we have completed level 
  2124.    ' ************************************************ 
  2125.    If BOMBS_TO_COLLECT=0
  2126.       _PLAYER_FRAME=9
  2127.       LEVEL_COMPLETE=1
  2128.    End If 
  2129.    ' *******************************
  2130.    ' send output back to main screen
  2131.    ' *******************************
  2132.    Screen 0
  2133. End Proc
  2134. Procedure STATUS_LEVEL
  2135.    ' *********************
  2136.    ' print to panel screen
  2137.    ' *********************
  2138.    Screen 1
  2139.    If LEVEL>9
  2140.       Paste Bob 266,16,151+Int(LEVEL/10)
  2141.       Paste Bob 276,16,151+(LEVEL-Int((LEVEL/10)*10))
  2142.    End If 
  2143.    If LEVEL<10
  2144.       Paste Bob 266,16,151
  2145.       Paste Bob 276,16,151+(LEVEL-Int((LEVEL/10)*10))
  2146.    End If 
  2147.    ' *******************************
  2148.    ' send output back to main screen
  2149.    ' *******************************
  2150.    Screen 0
  2151. End Proc
  2152. Procedure STATUS_SCORE
  2153.    I$="0123456789"
  2154.    SCORE_TO_ADD=(LEVEL+LIVES+1)*(100-(_MAX_LIVES*10))
  2155.    For _LOOP=1 To SCORE_TO_ADD
  2156.       Add SCORE,1
  2157.       SCORE$=Str$(SCORE)
  2158.       Screen 1
  2159.       X=180
  2160.       For COUNT=Len(SCORE$) To 1 Step -1
  2161.          IC$=Mid$(SCORE$,COUNT,1)
  2162.          I=Instr(I$,IC$)
  2163.          If I>0 Then Paste Bob X,19,I+150
  2164.          Add X,-10
  2165.       Next COUNT
  2166.    Next _LOOP
  2167. End Proc
  2168. Procedure STATUS_ENERGY
  2169.    ' *********************
  2170.    ' print to panel screen
  2171.    ' *********************
  2172.    Screen 1
  2173.    ' ****************** 
  2174.    ' remove energy bars 
  2175.    ' ****************** 
  2176.    Cls 5,39,15 To 63,30
  2177.    ' ************ 
  2178.    ' are we dying 
  2179.    ' ************ 
  2180.    If ENERGY<=0
  2181.       ' ***************************
  2182.       ' make all bombs non-existant
  2183.       ' ***************************
  2184.       For COUNT=0 To 4
  2185.          BOMB_STATE(COUNT)=0
  2186.       Next COUNT
  2187.       BOMBS_ON=0
  2188.       ' **************************** 
  2189.       ' change player state to dying 
  2190.       ' **************************** 
  2191.       _PLAYER_STATE=2
  2192.       _PLAYER_FRAME=43
  2193.       ' *******************
  2194.       ' aaaaarggghhhhh!!!!!
  2195.       ' *******************
  2196.       If SOUND=1
  2197.          Sam Raw 3,Start(10)+8212,5940,10000
  2198.       End If 
  2199.    End If 
  2200.    ' ****************************** 
  2201.    ' show new amount of energy bars 
  2202.    ' ****************************** 
  2203.    If ENERGY>0 and LIVES>-1
  2204.       X=39
  2205.       For COUNT=1 To ENERGY
  2206.          Paste Bob X,15,161
  2207.          Add X,7
  2208.       Next COUNT
  2209.    End If 
  2210.    ' ****************************** 
  2211.    ' put output back to main screen 
  2212.    ' ****************************** 
  2213.    Screen 0
  2214. End Proc
  2215.